Skip to content

fix: resolve all failing tests across api and shared packages#12

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier2-2301-1779437119
Open

fix: resolve all failing tests across api and shared packages#12
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier2-2301-1779437119

Conversation

@stooit
Copy link
Copy Markdown
Contributor

@stooit stooit commented May 22, 2026

Summary

  • Auth middleware: Fixed case-sensitivity bug in HTTP method comparison that caused POST requests to public routes to receive 401 responses
  • Users route: Added missing badRequest import that caused 500 errors instead of proper 400 validation responses
  • Shared types: Renamed userName field to username in the User type to match the API contract expected by consumers
  • Pagination utility: Implemented the paginate function (previously a stub) with 1-indexed page support

Testing

All 22 tests pass across 4 test files. No type errors in source files (npx tsc --noEmit clean except for expected environment-specific bun:test module resolution).

Assumptions

  • Pages in pagination are 1-indexed (matching test expectations)
  • The badRequest helper follows the same pattern as other response helpers in the codebase
  • HTTP method comparison should be case-insensitive per HTTP spec (RFC 7231)

- Fix auth middleware case-sensitivity bug in HTTP method comparison
- Add missing badRequest import in users route handler
- Rename userName to username in shared User type for consistency
- Implement paginate utility function with 1-indexed page support
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant